# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=more-itertools
pkgbase=python-${_realname}
pkgname=("python-${_realname}")
provides=("python3-${_realname}")
replaces=("python3-${_realname}")
conflicts=("python3-${_realname}")
pkgver=8.6.0
pkgrel=1
pkgdesc='More routines for operating on iterables, beyond itertools'
arch=('any')
url='https://github.com/erikrose/more-itertools'
#url='https://pypi.python.org/pypi/more-itertools'
license=('MIT')
makedepends=('python-setuptools')
depends=('python')
source=("https://files.pythonhosted.org/packages/source/m/more-itertools/more-itertools-${pkgver}.tar.gz")
sha512sums=('9fb6cbb1d303c79a1c67d1c473a161d71bc5d88c8ebaf290947c1a6e64c2a224478063c58ffc4d1dfdcb2931bcff9cd165bd8724a9e78e95c6f163000c138a5e')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  # Set version for setuptools_scm
  export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  /usr/bin/python setup.py install --root="${pkgdir}/" --optimize=0 --skip-build
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
